resource

Class: com.microstrategy.web.app.taglibs.BaseTag

Usage:

This tag allows users to include different resources like images, javascript and css style files in the HTML output of a JSP based on the resource type.
The location of these resources is configured through a series of initialization parameters pointing to all the different resource folders used by the application. These include:
  • resourcesFolderImage: The base location of the images to be used in the application
  • resourcesFolderJavaScript: The base location of the javascript files to be used in the application
  • resourcesFolderCustom: The base location of the customizations folders
  • resourcesFolderStyleFixedFont: The base location of the css files to be used in the application, when the size of the font to be presented to the user is fixed
  • resourcesFolderStyle: The base location of the css files to be used in the application
  • resourcesFolderStyleDB: The base location of the css files to be used in the application, when the environment is double byte
  • resourcesFolderStyleFixedFontDB: The base location of the css files to be used in the application, when the environment is double byte and the size of the font to be presented to the user is fixed
    Based on the type attribute, this custom-tab will identify the correct location and the HTML-tag that is required to include the file in the HTML output. For example:
     <web:resource type="javascript" name="DHTML.js" runat="server"/>
     
    This will gather the resource folder information corresponding to resourcesFolderJavaScript and use it to generate a <script> tag to includes the DHTML.js file. The output generated by the tag for the previous example will be:
     <script language="javascript" src="../javascript/DHTML.js"><!-- --></script>
     
    The following table resumes the output generetad by the tag based on the type attribute.
    Type Init Parameter Output
    javascript resourcesFolderJavaScript <script src="../javascript/custom.js" language="javascript" </script>
    style resourceFolderStyle <link href="../style/cssFile.css" rel="stylesheet" type="text/css" />
    image resourcesFolderImage <img src="../images/1ptrans.gif" name="arrow" id="arrow" />
    jsp resourcesFolderJSP <iframe href="../jsp/blah.jsp" name="blah.jsp" id="blah.jsp" ></iframe>
    section none The name of the section associated with the givne name for the current page, for example:
    /jsp/Report_Content.jsp
    helpfile none The contents of the helpfile associated with the given name.
    custom-style resourcesFolderCustom If name is provided, then a link to the file in the style's custom folder, for example:
    <link href="../plugins/Customizations/style/cssFile.css" rel="stylesheet" type="text/css" />

    If name is not provided, then links to the global.css or the page's css if they exists in a style's custom folder, for example:
    <link href="../plugins/Customizations/style/global.css" rel="stylesheet" type="text/css" />
    <link href="../plugins/Customizations/style/welcomePage.css" rel="stylesheet" type="text/css" />
    custom-javascript resourcesFolderCustom If name is provided, then a link to the file in the javascript's custom folder, for example:
    <script src="../plugins/Customizations/javascript/custom.js" language="javascript" </script>

    If name is not provided, then links to the global.css or the page's css if they exists in a style's custom folder, for example:
    <script src="../plugins/Customizations/javascript/global.js" language="javascript" </script>
    <script src="../plugins/Customizations/javascript/welcomePage.js" language="javascript" </script>


    Users can also specify an optional attribute attribute. If the value of this attribute is set, the custom-tag will not generate the HTML-tag, but will simply generate the corresponding value as the value of the tag, for example:

    Name Required? Description
    attribute false Indicates the HTML tag attribute to create and to which the resource information value obtained will be assigned to.
    Usage:
    Use this attribute whenever this tag is meant to be used inside another HTML tag. The HTML code generated by this custom tag will include only the attribute and assigning to it the value retrieved as resource information.
    The following example shows how the src attribute is set on the script tag:
    bundleName false This is specific to the tags with type "jsbundle". Indicates which JavaScript bundle should be included in the page.
    Usage:
    When the corresponding debugFlag EnumWebAppDebugFlags is enabled, it will generate a group of "script" tags to include all the JavaScript files in the bundle individually.
    Otherwise, the entire bundle file (which is compressed, and concatenated as a single .js file) will be included.
    debugBundleName false This is specific to the tags with type "jsbundle". This tag will play a roll only when the When the corresponding debugFlag EnumWebAppDebugFlags is enabled, Indicates which JavaScript debug bundle should be included in the page.
    Usage:
    When the corresponding debugFlag EnumWebAppDebugFlags is enabled:
    If the debugBundle is specifed with a bundle name, include the debugBundle instead of the default bundle.
    If the debugBundle is not specified, include individual files in the default bundle.
    location false This is specific to the tags with type "javascript". Indicates the location where the output will be added in the generated html when the resource manager is enabled
    Usage:
    When the resource manager is enabled, the javascript files are normally output at the bottom of the html page. Setting the location to "head" would generate this tag output within the head section of the html page.
    name false Indicates the name only (and any extra path information if necessary) of the file to which the resource path information will be added.
    Usage:
    In the case of images, styles and javascripts, this attribute specifies the name of the file to be used. The tag will take care of adding the path for being able to reach it. When using the type attribute set as section, it represents the name of the section on the template that is being requested.
    runat true Indicates that the ASP.Net control should be processed on the server
    type false Indicates the type of resource folder information it will search for in order to complete the path information for the file specified.
    Usage:
    The possible values for this attribute include:
  • helpfile: The information to obtain will correspond to the location of the help file to be shown to the user
  • image: The information to obtain will include the full resource path where the images are located. If the attribute value is not specified, it will default to obtain the image resource path.
  • javascript: The information to obtain will include the full resource path where the javascript files are located.
  • section: The information to obtain will correspond to the path and file name of the specified section on the PageComponent template.
  • style: The information to obtain will include the full resource path where the style files are located. Some extra logic is executed for determining which one of the possible four resource paths should be used, depending on the environment from the user is calling the request.
  • custom-style: The information to obtain will include the full resource path where custom style files are located.
  • custom-javascript: The information to obtain will include the full resource path where custom javascript files are located.